<?php

namespace app\utils\base\helper;

class Ltcms_rand_name
{
    /**
     * 获取名称
     */
    public function name($paramObj="")
    {
        $dataObj=paramsObj();
        $dataObj->request=paramsObj();
        $dataObj->data=paramsObj();

        $final_arr=logInit();
        if($final_arr["error_no"]==0){
            $mixed=parseToArr($paramObj,"mixed",0);
            $params=parseToArr($paramObj,"params",array());
            $messages=parseToArr($paramObj,"messages",array());
            $rules=array(
                'id' => '',
            );
            $dataDefault=array();
            $paramsObj=paramsObj();
            $paramsObj->params=$params;
            $paramsObj->mixed=$mixed;
            $paramsObj->rules=$rules;
            $paramsObj->messages=$messages;
            $paramsObj->dataDefault=$dataDefault;
            $checkResult = app("verifyParam")::validatorRequest($paramsObj);
            if($checkResult["error_no"]==0){
                $dataObj->request=$checkResult["result"];
            }else{
                $final_arr=logCallErrorMsg($final_arr,$checkResult);
            }
        }
        if($final_arr["error_no"]==0)
        {
            $name="";
            $id=$dataObj->request->id;
            if($id){
                $arr1=['高','张','刘','王','陈','何','金','李','丁','马'];
                $arr2=['楠','夕','熙','原','书','同','悦','俊','阳','龙'];
                $arr3=['东','一','','远','','林','华','明','',''];
                $str1=substr($id,-1,1);
                if($id >=10){
                    $str2=substr($id,-2,1);
                }else{
                    $str2=$id;
                }
                if($id >=100){
                    $str3=substr($id,-3,1);
                }else{
                    $str3=$str2;
                }
                $name= $arr1[$str1].$arr2[$str2].$arr3[$str3];
            }
            $final_arr["result"]=$name;
        }
        return $final_arr;
    }
}